package com.atguigu.tingshu.payment.client;

import com.atguigu.tingshu.dto.PaymentDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/***
 * 支付相关内部接口的控制层
 */
@FeignClient(name = "service-payment", path = "/client/pay/payment", contextId = "paymentFeignClient")
public interface PaymentFeignClient {

    /**
     * 获取支付地址
     * @param paymentDto
     * @return
     */
    @PostMapping(value = "/getPayAddress")
    public String getPayAddress(@RequestBody PaymentDto paymentDto);

    /**
     * 主动查询支付结果
     * @param orderNo
     * @return
     */
    @GetMapping(value = "/getPayResult")
    public Boolean getPayResult(@RequestParam String orderNo, @RequestParam String payway);
}
